<template>
  <div id="app">
    <button @click="gobuy">点击购买</button>
  </div>
</template>

<script>
import RePlayBuy from "../../src/c-replay-pay/buy";

import  ConfirmBoxDialog  from "../../src/c-replay-pay/components/ConfirmBox/index"
export default {
   created() {
    console.log('待支付');
  },
  mounted(){
    setTimeout(()=>{
      new ConfirmBoxDialog().perform({
        isAutoSkip:false
      })
    },1000)
  },
  methods:{
   gobuy(){
      const info =  new RePlayBuy(
      {
        common_auth_code:''
      }, 
      { 
        redirectUrl:'https://www.baidu.com/', 
        paySuccessUrl: 'https://www.baidu.com/', 
        payFailUrl: 'https://www.youtube.com/'
      },
      {
       order_id:'o_1723106870_66b4863649a5e_782647V2',
      },true)
       //支付弹窗
       info.getPayWay().then(({ payWayInfo, showSelectPayWay})=>{
         if(showSelectPayWay === 2){
          //  alert('关闭了')
         }else{
           //下单支付
          
           info.perform({ payWayInfo})
         }
       })
    }
  }
};
</script>

<style lang="scss">
html {
  font-size: 50px;
}
</style>

